/*
 * ECARX Technology Limited is the owner of the copyright and the trade secret of this software.
 * Without permission, no one has the right to obtain, disclose or use this software in any way.
 */

package com.ecarx.systemui.plugin;

import com.ecarx.systemui.plugin.utils.LogUtils;

public class AppConstants {
    private static final String TAG = "AppConstantsTag";

    public static final int PLUGIN_DIALOG_TYPE = 2020;

    public static final int HVAC_FAN_SPEED_0 = 0;

    public static final int HVAC_HAND_FAN_SPEED_1 = 1;
    public static final int HVAC_HAND_FAN_SPEED_2 = 2;
    public static final int HVAC_HAND_FAN_SPEED_3 = 3;
    public static final int HVAC_HAND_FAN_SPEED_4 = 4;
    public static final int HVAC_HAND_FAN_SPEED_5 = 5;
    public static final int HVAC_HAND_FAN_SPEED_6 = 6;
    public static final int HVAC_HAND_FAN_SPEED_7 = 7;
    public static final int HVAC_HAND_FAN_SPEED_8 = 8;
    public static final int HVAC_HAND_FAN_SPEED_9 = 9;

    public static final int HVAC_AUTO_FAN_SPEED_10 = 268567041; //AUTO_FAN_SETTING_SILENT
    public static final int PRO_AUTO_FAN_SPEED_10 = 0; //AUTO_FAN_SETTING_SILENT

    public static final int HVAC_AUTO_FAN_SPEED_11 = 268567042; //AUTO_FAN_SETTING_NORMAL
    public static final int PRO_AUTO_FAN_SPEED_11 = 1; //AUTO_FAN_SETTING_NORMAL

    public static final int HVAC_AUTO_FAN_SPEED_12 = 268567043; //AUTO_FAN_SETTING_HIGH
    public static final int PRO_AUTO_FAN_SPEED_12 = 2; //AUTO_FAN_SETTING_HIGH

    public static final int HVAC_AUTO_FAN_SPEED_13 = 268567044; //AUTO_FAN_SETTING_QUIETER
    public static final int PRO_AUTO_FAN_SPEED_13 = 3; //AUTO_FAN_SETTING_QUIETER

    public static final int HVAC_AUTO_FAN_SPEED_14 = 268567045; //AUTO_FAN_SETTING_HIGHER
    public static final int PRO_AUTO_FAN_SPEED_14 = 4; //AUTO_FAN_SETTING_HIGHER


    public static final int HEAT_LEVEL_0 = 0;
    public static final int HEAT_LEVEL_1 = 1;
    public static final int HEAT_LEVEL_2 = 2;
    public static final int HEAT_LEVEL_3 = 3;


    public static int getCenterFanIconByFanValue(boolean isAuto,Integer fanValue) {
        switch (fanValue) {
            case AppConstants.HVAC_FAN_SPEED_0:
                if(isAuto){
                    return R.drawable.auto_speed_level_0;
                }else{
                    return R.drawable.hand_speed_level_0;
                }
            case AppConstants.HVAC_HAND_FAN_SPEED_1:
                return R.drawable.hand_speed_level_1;
            case AppConstants.HVAC_HAND_FAN_SPEED_2:
                return R.drawable.hand_speed_level_2;
            case AppConstants.HVAC_HAND_FAN_SPEED_3:
                return R.drawable.hand_speed_level_3;
            case AppConstants.HVAC_HAND_FAN_SPEED_4:
                return R.drawable.hand_speed_level_4;
            case AppConstants.HVAC_HAND_FAN_SPEED_5:
                return R.drawable.hand_speed_level_5;
            case AppConstants.HVAC_HAND_FAN_SPEED_6:
                return R.drawable.hand_speed_level_6;
            case AppConstants.HVAC_HAND_FAN_SPEED_7:
                return R.drawable.hand_speed_level_7;
            case AppConstants.HVAC_HAND_FAN_SPEED_8:
                return R.drawable.hand_speed_level_8;
            case AppConstants.HVAC_HAND_FAN_SPEED_9:
                return R.drawable.hand_speed_level_9;

            case AppConstants.HVAC_AUTO_FAN_SPEED_10:
                return R.drawable.auto_speed_level_2;
            case AppConstants.HVAC_AUTO_FAN_SPEED_11:
                return R.drawable.auto_speed_level_3;
            case AppConstants.HVAC_AUTO_FAN_SPEED_12:
                return R.drawable.auto_speed_level_4;
            case AppConstants.HVAC_AUTO_FAN_SPEED_13:
                return R.drawable.auto_speed_level_1;
            case AppConstants.HVAC_AUTO_FAN_SPEED_14:
                return R.drawable.auto_speed_level_5;
        }
        LogUtils.d(TAG, "Not FanValue");
        return 0;
    }

    public static int getLeftHandFanIconByFanValue(Integer hanFanValue) {
        switch (hanFanValue) {
            case AppConstants.HVAC_FAN_SPEED_0:
                return R.drawable.fan_0;
            case AppConstants.HVAC_HAND_FAN_SPEED_1:
                return R.drawable.fan_1;
            case AppConstants.HVAC_HAND_FAN_SPEED_2:
                return R.drawable.fan_2;
            case AppConstants.HVAC_HAND_FAN_SPEED_3:
                return R.drawable.fan_3;
            case AppConstants.HVAC_HAND_FAN_SPEED_4:
                return R.drawable.fan_4;
            case AppConstants.HVAC_HAND_FAN_SPEED_5:
                return R.drawable.fan_5;
            case AppConstants.HVAC_HAND_FAN_SPEED_6:
                return R.drawable.fan_6;
            case AppConstants.HVAC_HAND_FAN_SPEED_7:
                return R.drawable.fan_7;
            case AppConstants.HVAC_HAND_FAN_SPEED_8:
                return R.drawable.fan_8;
            case AppConstants.HVAC_HAND_FAN_SPEED_9:
                return R.drawable.fan_9;
        }
        LogUtils.d(TAG, "Not FanValue");
        return 0;
    }

}
